import {MyDetail} from "../classes/MyUI.js";
import {MyMBR, MyMBRDptItem} from "../AbstractClass/MySystem.js";

const myDetail = new MyDetail(
    "This is a title.",
    [
        "Details for abc.",
        "Details for def.",
    ]
);
document.getElementById("myDetail").appendChild(myDetail.getElement());

let myMBR = new MyMBR();
myMBR.pushDptItem(new MyMBRDptItem(1, "mbr", 0, 1));
myMBR.pushDptItem(new MyMBRDptItem(1, "main", 1, 32768));
myMBR.pushDptItem(new MyMBRDptItem(1, "swap", 32769, 32728));

let blocks_container = document.getElementById("blocks_container");
let progress_block = document.getElementById("progress_block");
let mem_block = document.getElementById("mem_block");
let pcb_block = document.getElementById("pcb_block");
let inode_block = document.getElementById("inode_block");
let address_space_block = document.getElementById("address_space_block");
// 相对于父元素的偏移量，可以用来定位；
console.log(mem_block.offsetTop - blocks_container.offsetTop);
console.log(blocks_container.childNodes);


let i = false;

setInterval(()=>{
    let distanceY = 401;
    if (i===true){
        i = false;
    }
    else {
        i = true;
        distanceY = 1203;
    }
    anime({
        targets: blocks_container,
        translateY: -distanceY,
        easing: 'easeInQuad',
    })
}, 2000);